@echo off
echo ===================================
echo  Starting Blog Project Installation
echo ===================================

echo.
echo [1/2] Installing Backend Dependencies...
cd backend
call npm install
if %errorlevel% neq 0 (
    echo.
    echo ERROR: Failed to install backend dependencies.
    exit /b %errorlevel%
)
echo Backend dependencies installed successfully.

echo.
echo [2/2] Installing Frontend Dependencies...
cd ../frontend
call npm install
if %errorlevel% neq 0 (
    echo.
    echo ERROR: Failed to install frontend dependencies.
    exit /b %errorlevel%
)
echo Frontend dependencies installed successfully.

echo.
echo ===================================
echo  Installation Complete!
echo ===================================
echo.
echo To run the application:
echo 1. Open a terminal, navigate to the 'backend' directory and run: npm start
echo 2. Open another terminal, navigate to the 'frontend' directory and run: npm run dev
pause